package com.gxz.springboot.controller;

import com.gxz.springboot.Bean.Monster;
import com.gxz.springboot.service.MonsterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MonsterController {
    @Autowired
    MonsterService monsterService;

    @ResponseBody
    @GetMapping("/monster")
    public Monster getByMonsterId(@RequestParam("id") Integer id) {
        return monsterService.getMonsterById(id);
    }
}
